import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import path from "path";
export default defineConfig({
  plugins: [vue()],
  server: {
    host: "0.0.0.0",
    // 代理
    // proxy: {
    //   api: {
    //     target: "http://localhost:3000",
    //     changeOrigin: true,
    //     rewrite: (path) => path.replace(/^\/api/, ""),
    //     secure: false,
    //   },
    //   "/ppic": {
    //     target: "http://localhost:3000",
    //     changeOrigin: true,
    //     rewrite: (path) => path.replace(/^\/ppic/, ""),
    //     secure: false,
    //   },
    // },
  },
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "src"), // 将'@'指向src目录
    },
  },
});
